import type { ThemeConfig } from 'antd';

// Antd 主题配置
export const antdTheme: ThemeConfig = {
  cssVar: true,
  token: {
    // 主色
    colorPrimary: '#0065F2',
    colorSuccess: '#52c41a',
    colorWarning: '#faad14',
    colorError: '#f5222d',
    colorInfo: '#1890ff',

    // 中性色
    colorTextBase: '#000000d9',
    colorBgBase: '#ffffff',

    // 圆角
    borderRadius: 6,

    // 字体
    fontSize: 14,
    fontFamily: `-apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
      'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji',
      'Segoe UI Emoji', 'Segoe UI Symbol'`,

    // 间距
    padding: 16,
    margin: 16,

    // 阴影
    boxShadow:
      '0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05)',

    // 动画
    motionDurationSlow: '0.3s',
    motionDurationMid: '0.2s',
    motionDurationFast: '0.1s',
  },
  hashed: false,
  components: {
    Layout: {
      headerBg: '#ffffff',
      headerHeight: 64,
      siderBg: '#001529',
      triggerBg: '#002140',
    },
    Menu: {
      darkItemBg: '#001529',
      darkSubMenuItemBg: '#000c17',
      darkItemSelectedBg: '#1890ff',
      darkItemHoverBg: '#112545',
    },
    Button: {
      borderRadius: 6,
      controlHeight: 32,
    },
    Input: {
      borderRadius: 6,
      controlHeight: 32,
    },
    Select: {
      borderRadius: 6,
      controlHeight: 32,
    },
    Card: {
      borderRadius: 8,
      paddingLG: 24,
    },
    Table: {
      borderRadius: 6,
      headerBg: '#fafafa',
    },
  },
  algorithm: [], // 可以添加 theme.darkAlgorithm 来支持暗色主题
};

// 暗色主题配置
export const darkTheme: ThemeConfig = {
  ...antdTheme,
  algorithm: [], // 这里可以导入 theme.darkAlgorithm
  token: {
    ...antdTheme.token,
    colorBgBase: '#141414',
    colorTextBase: '#ffffff',
  },
};
